from django.template.library import Library
from collect.models import Collect

register = Library()


@register.filter
def has_collected(article, user):
    if Collect.objects.filter(article=article, user=user).exists():
        return True
    else:
        return False
